﻿using MediatR;
using StoreIGet.Applications.Command;
using StoreIModels;
using StoreRepositorys.Interface;

namespace StoreIGet.Applications.CommandHandler
{
    public class PictureShowCommandHandler : IRequestHandler<PictureShowCommand, List<PictureModel>>
    {
        public readonly IPictureRepository _pictureRepository;
        public PictureShowCommandHandler(IPictureRepository pictureRepository)
        {
            _pictureRepository = pictureRepository;
        }

        public async Task<List<PictureModel>> Handle(PictureShowCommand request, CancellationToken cancellationToken)
        {
            return await _pictureRepository.GetAllasync();

        }
    }
}
